package com.hippy.erya.exception;

import lombok.extern.slf4j.Slf4j;


@Slf4j
public class EyExceptionResult {

    public static String handleException(Exception e) {
        e.printStackTrace();
        log.error("e=========>" + e);
        if (e instanceof BaseException) {
            BaseException baseException = (BaseException) e;
            return baseException.getExtraMsg();
        }
        return e.getMessage();
    }

    public static String handleException(Exception e , String message) {
        e.printStackTrace();
        log.error("e=========>" + e);
        if (e instanceof BaseException) {
            BaseException baseException = (BaseException) e;
            return baseException.getExtraMsg();
        }
        return message;
    }
}
